package com.boarsoft.boar.batch.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.boarsoft.boar.batch.bean.BatchExecCtrlFlag;
import com.boarsoft.boar.batch.service.BatchExecCtrlService;

public class BatchExecCtrlServiceImpl implements BatchExecCtrlService {

	private static final Logger log = LoggerFactory.getLogger(BatchExecCtrlServiceImpl.class);

	@Override
	public Boolean setStatus(String batchNo, Short status) {
		BatchExecCtrlFlag.setStatus(batchNo, status);
		log.info("设置批次：{}，的状态为：{} ", batchNo, status);
		return Boolean.TRUE;
	}

	@Override
	public Short getStatus(String batchNo) {
		return BatchExecCtrlFlag.getStatus(batchNo);
	}

	@Override
	public Boolean removeStatusBykey(String batchNo) {
		BatchExecCtrlFlag.removeStatus(batchNo);
		log.info("移除批次：{}，的缓存 ", batchNo);
		return Boolean.TRUE;
	}

	@Override
	public Boolean clearStatusAll() {
		BatchExecCtrlFlag.clearAllStatus();
		return Boolean.TRUE;
	}

	@Override
	public Boolean setExeType(String batchNo, Short status) {
		BatchExecCtrlFlag.setExeType(batchNo, status);
		return Boolean.TRUE;
	}

	@Override
	public Short getExeType(String batchNo) {
		return BatchExecCtrlFlag.getExeType(batchNo);
	}

	@Override
	public Boolean removeExeTypeBykey(String batchNo) {
		BatchExecCtrlFlag.removeExeType(batchNo);
		return Boolean.TRUE;
	}

	@Override
	public Boolean clearExeTypeAll() {
		BatchExecCtrlFlag.clearAllExeType();
		return Boolean.TRUE;
	}
}
